
%-----------------------------------------------------------------------------------------------
% Salzburg University of Applied Sciences Bachelor Thesis -- LaTeX style macros
%-----------------------------------------------------------------------------------------------

% Page layout

%\makeatletter
\oddsidemargin 0.5cm 
\evensidemargin 0.5cm		
\marginparwidth 40pt \marginparsep 0pt
%\topmargin -1cm \headsep .5cm \headheight 14pt
\topmargin -1cm \headsep 8mm \headheight 14pt
\footskip 14pt
\textheight 20cm \textwidth 15cm
\parskip 7pt plus 2pt minus 2pt
\if@twoside\else\flushbottom\fi
\brokenpenalty=10000

\renewenvironment{itemize}{
   \begin{list}{$\bullet$}
    { \setlength{\itemsep}{0pt}
      \setlength{\parsep}{3pt}
      \setlength{\topsep}{-2pt}
      } }
    {
    \end{list}  }


%New names
\renewcommand{\listtablename}{Tabellenverzeichnis}
\renewcommand{\listfigurename}{Abbildungsverzeichnis}
\renewcommand{\contentsname}{Inhaltsverzeichnis}
\renewcommand{\baselinestretch}{1.25}\normalsize

\newif\ifmainpage \mainpagetrue
\def\@makechapterhead#1{\ifmainpage \vspace*{50pt} \fi 
 { \parindent 0pt \raggedright 
 \ifnum \c@secnumdepth >\m@ne \huge\bf \thechapter \vskip 5pt \hrule height1pt 
 \par \vskip 15pt \fi \huge \bf #1\par 
 \nobreak \vskip 40pt }}

% Commented - not needed anywhere and causes problems with "color" package
%\def\@xfloat#1[#2]{\ifhmode \@bsphack\@floatpenalty -\@Mii\else
%   \@floatpenalty-\@Miii\fi\def\@captype{#1}\ifinner
%      \@parmoderr\@floatpenalty\z@
%    \else\@next\@currbox\@freelist{\@tempcnta\csname ftype@#1\endcsname
%       \multiply\@tempcnta\@xxxii\advance\@tempcnta\sixt@@n
%       \@tfor \@tempa :=#2\do
%                        {\if\@tempa h\advance\@tempcnta \@ne\fi
%                         \if\@tempa t\advance\@tempcnta \tw@\fi
%                         \if\@tempa b\advance\@tempcnta 4\relax\fi
%                         \if\@tempa p\advance\@tempcnta 8\relax\fi
%         }\global\count\@currbox\@tempcnta}\@fltovf\fi
%    \global\setbox\@currbox\vbox\bgroup 
%    \def\baselinestretch{1}\@normalsize
%    \boxmaxdepth\z@
%    \hsize\columnwidth \@parboxrestore}

% Redefine the macro used for footnotes to use single spacing

%\long\def\@footnotetext#1{\insert\footins{\def\baselinestretch{1}\footnotesize
%    \interlinepenalty\interfootnotelinepenalty 
%    \splittopskip\footnotesep
%    \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
%    \hsize\columnwidth \@parboxrestore
%   \edef\@currentlabel{\csname p@footnote\endcsname\@thefnmark}\@makefntext
%    {\rule{\z@}{\footnotesep}\ignorespaces
%     #1\strut}}}

% Some changes to meet my preferences for sectioning

\def\chapter{\clearpage     
   \thispagestyle{plain}    
   \global\@topnum\z@       
   \@afterindenttrue       
   \secdef\@chapter\@schapter}
%\def\sections{\@startsection {section}{2}{\z@}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex}{\huge\bf}}
\def\section{\@startsection {section}{2}{\z@}{1.7ex plus 1ex minus .2ex}{1.3ex plus .2ex}{\Large\bf}}
\def\subsection{\@startsection{subsection}{3}{\z@}{1.0ex plus 1ex minus .2ex}{0.7ex plus .2ex}{\large\bf}}
\def\paragraph{\@startsection
     {paragraph}{5}{\z@}{1.3ex plus 1ex minus .2ex}{-1em}{\normalsize\bf}}

% Bibliography style used by University of Waterloo (Thanks Todd!)
\def\thebibliography#1{\chapter{Literaturverzeichnis\@mkboth
  {Literaturverzeichnis}{Literaturverzeichnis}}%\addcontentsline{toc}{section}{Literaturverzeichnis}


\list
  {[\arabic{enumi}]}{\settowidth\labelwidth{[#1]}\leftmargin\labelwidth
    \advance\leftmargin\labelsep
    \usecounter{enumi}}
    \def\newblock{\hskip .11em plus .33em minus .07em}
    \sloppy\clubpenalty4000\widowpenalty4000
    \sfcode`\.=1000\relax}
  
\let\endthebibliography=\endlist

% Appendix style used by IUB
\def\appendix{\par
 \setcounter{chapter}{0}
 \setcounter{section}{0}
 \mainpagefalse
 \def\@chapapp{Appendix}
 \def\thechapter{\Alph{chapter}}
 \if@twoside
 \def\chaptermark##1{\markboth {\rm{\ifnum \c@secnumdepth >\m@ne
      \thechapter. \ \fi ##1}}{\rm{\ifnum \c@secnumdepth >\m@ne
      \thechapter. \ \fi ##1}}}
 \fi
}

% Definitions for front matters

\def\fhsupervisor#1{\gdef\@fhsupervisor{#1}}
\def\worksupervisor#1{\gdef\@worksupervisor{#1}}
\def\copyrightyear#1{\gdef\@copyrightyear{#1}} % \author, \title in report
\def\@title{}\def\@author{}
\def\@submitmonth{\ifcase\the\month\or
  J\"anner\or Februar\or M\"arz\or April\or Mai\or Juni\or Juli\or August\or September\or Oktober\or November\or Dezember\fi \space
\number\the\year}
\def\@submitdate{}
\ifnum\month=12
    \@tempcnta=\year \advance\@tempcnta by 1
\edef\@copyrightyear{\number\the\@tempcnta}
\else
    \def\@copyrightyear{\number\the\year}
\fi
\newif\ifcopyright \newif\iffigurespage \newif\iftablespage
\copyrighttrue \figurespagetrue \tablespagetrue

% Title page definitions FH Salzburg

% Modifications for bachelor thesis 1
% Changed title text
\def\titlep{
\thispagestyle{empty}	\null\vskip 0in	
\begin{center}
{\huge\uppercase\expandafter{\bf{Bachelorarbeit}}}\\
\end{center}	\vfill
\begin{center}
{\large\expandafter{\bf{\LARGE\@title}}}		
\end{center}	\vfill
\begin{center}
\large durchgef\"uhrt am Bachelorstudiengang\\
Informationstechnik und System--Management\\
Fachhochschule Salzburg GmbH\\
\end{center}
\vfill
\begin{center}
\large vorgelegt von:\\		
{\bf{\large\@author}}\\	
\end{center}	
\vfill	

\begin{center}
\includegraphics[width=4cm]{FHLogo}\\
\end{center}	
\vfill	

\begin{center}
\begin{tabular}{p{5cm} p{7cm}}
\large Studiengangsleiter: & FH-Prof.~DI Dr.~Gerhard J\"ochtl\\
\large Betreuer: & {\@fhsupervisor}
\end{tabular}		
\end{center}	
\vfill	

\begin{center}
\large Salzburg, \@submitmonth\\
\end{center}
\vskip 0in \newpage}

\def\copyrightpage{
\null\vfill	
% \begin{center}
% \Large Copyright \copyright\ 
% \@copyrightyear\\		
% \@author\\
% ALLE RECHTE VORBEHALTEN\\
% \end{center}	
\vfill\newpage}

\def\acknowledgementpage{%
\section*{Danksagung\markboth{Danksagung}{Danksagung}}
\addcontentsline{toc}{chapter}{Danksagung}
\input{acknowledge}
\vfill\newpage}



\def\dedicationpage{%
\null\vfill
\input{dedication}
\vfill\newpage}


\def\eidespage{%
	\section*{Eidesstattliche Erkl\"arung\markboth{Eidesstattliche Erkl\"arung}{Eidesstattliche Erkl\"arung}}
	\addcontentsline{toc}{chapter}{Eidesstattliche Erkl\"arung}
	\input{law}
	%%\@author
\vfill\newpage}

% Modifications for bachelor thesis 1
% Details page stripped down to abstracts (added german abstract)
\def\detailspage{%
%	\section*{Informationen\markboth{Informationen}{Informationen}}
%	\addcontentsline{toc}{chapter}{Informationen}
%	\parindent 0pt
%	\begin{tabular}{p{4.5cm} p{8cm}}
%	Vor- und Zuname:&{\@author} \\
%	Institution:&Fachhochschule Salzburg GmbH\\
%	Studiengang:&Informationstechnik \& System-Management\\
%	Titel der Diplomarbeit:&{\@title}\\
%	Betreuer an der FH:&{\@fhsupervisor}\\
%	Betreuer in der Firma:&{\@worksupervisor}
%	\end{tabular}		
%	\section*{Schlagw\"orter}
%	\addcontentsline{toc}{chapter}{Schlagw\"orter}
%	\parindent 0pt
%	\input{keywords}
	\section*{Kurzzusammenfassung}
	\addcontentsline{toc}{chapter}{Kurzzusammenfassung}
% \parindent 0pt
\setlength{\parindent}{0}
	\input{abstract_de}
	\section*{Abstract}
	\addcontentsline{toc}{chapter}{Abstract}
	\parindent 0pt
	\input{abstract_en}
	\vfill\newpage}

\def\vitapage{%
	\section*{Curriculum Vitae}
	\thispagestyle{empty}
	\pagestyle{empty}
	\input{vitae}
\vfill\newpage}

\def\appendixpage{%
	\chapter*{Anhang\markboth{Anhang}{Anhang}}
	\addcontentsline{toc}{chapter}{Anhang}
	\thispagestyle{plain}
	\input{appendix}
\vfill\newpage}

\def\abbrevpage{%
	\chapter*{Abk\"urzungsverzeichnis\markboth{Abk\"urzungsverzeichnis}{Abk\"urzungsverzeichnis}}
	\addcontentsline{toc}{chapter}{Abk\"urzungsverzeichnis}
	\thispagestyle{plain}
	\input{abbreviations}
\vfill\newpage}

\def\indexpage{%
	\chapter*{Index\markboth{Index}{Index}}
	\addcontentsline{toc}{chapter}{Index}
	\thispagestyle{plain}
	\printindex
\vfill\newpage}


\def\glossarypage{%
	\chapter*{Glossar\markboth{Glossar}{Glossar}}
	\addcontentsline{toc}{chapter}{Glossar}
	\thispagestyle{plain}
	\input{glossary}
\vfill\newpage}

% Acknowledgment page omitted for bachelor thesis
\def\beforepreface{
	\pagenumbering{roman}
	\pagestyle{plain}
	\titlep
%	\ifcopyright\copyrightpage\fi
%        \dedicationpage
        \eidespage
%	\acknowledgementpage
}

\def\prefacesection#1{%
	\chapter*{#1}
	\addcontentsline{toc}{chapter}{#1}}

\def\abstractpage{%
	\chapter*{Abstract}
	\addcontentsline{toc}{chapter}{Abstract}
	\input{abstract}
	\vfill\newpage}

% The following section is copied and \uppercase is changed to \sl to
% modify running head on pages (other that all uppercase).
% It also draws a line after the head

\if@twoside         % If two-sided printing.
\def\ps@headings{\let\@mkboth\markboth
\def\@oddfoot{}\def\@evenfoot{}		% No feet.
\def\@evenhead{\vbox{\hbox to \textwidth{\rm\thepage\hfil\rm\leftmark}
	\break\smallskip\hrule}}	%  Left heading.
\def\@oddhead{\vbox{\hbox to \textwidth{\rm\rightmark\hfil\rm\thepage}
	\break\smallskip\hrule}}	% Right heading.
\def\chaptermark##1{\markboth {\rm{\ifnum \c@secnumdepth >\m@ne
      \thechapter. \ \fi ##1}}{}}
\def\sectionmark##1{\markright {\rm{\ifnum \c@secnumdepth >\z@
   \thesection. \ \fi ##1}}}}
\else               % If one-sided printing.
\def\ps@headings{\let\@mkboth\markboth
\def\@oddfoot{}\def\@evenfoot{}		% No feet.
%\def\@oddhead{\hbox{}\sl\rightmark \hfil\rm\thepage}
\def\@oddhead{\vbox{\hbox to \textwidth{\rm\rightmark\hfil\rm\thepage}
		\break\smallskip\hrule}} %% Heading.
\def\chaptermark##1{\markright{\rm{\ifnum \c@secnumdepth >\m@ne 
	\thechapter. \ \fi ##1}}}}
\fi

% Afterpreface. Uncomment the lines if you don't want to have any
% extra spaces between chapters.

\def\afterpreface{\newpage
        \detailspage
	\setcounter {tocdepth}{5}
	\addcontentsline{toc}{chapter}{Inhaltsverzeichnis}
	\tableofcontents
	\setcounter{tocdepth}{5}
	\clearpage
	\phantomsection
	\newpage
	\addcontentsline{toc}{chapter}{Abbildungsverzeichnis}
	\listoffigures
	\clearpage
	\phantomsection
	\newpage
	\addcontentsline{toc}{chapter}{Tabellenverzeichnis}
	\listoftables
	\clearpage
	\phantomsection
	\newpage
	\pagenumbering{arabic}
	\pagestyle{headings}}

% Start with pagestyle{headings} in case front matter isn't processed

\pagestyle{headings}
\makeatother














